<%@ page language="java" contentType="text/html; charset=utf-8"
		 pageEncoding="utf-8"%>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="weaver.common.DateUtil" %>
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="weaver.general.Util" %>
<%
	JSONObject jsonData = new JSONObject();
	RecordSet rs = new RecordSet();
	String jsrq = Util.null2String(request.getParameter("xzcl"));
	String workDate = "";
	int workDateCount = 0;
	for (int i = 0; i < 20; i++) {
		String newDate = DateUtil.addDate(jsrq,i);
		rs.executeQuery("select count(id) from kq_HolidaySet where holidayDate=?",newDate);
		rs.next();
		int count = Util.getIntValue(rs.getString(1));
		if(count<=0){
			int week = DateUtil.getWeek(jsrq);
			if(week<=5){
				workDate = newDate;
				workDateCount++;
			}
		}
		if(workDateCount==3){
			break;
		}
	}

	jsonData.put( "workDate", workDate );
	out.print( jsonData.toJSONString() );
%>
